package org.doubango.FrCall.Screens;
//package org.douban.frcall;

import org.doubango.FrCall.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;

public class SearchFriendByRule extends Activity {
	private Spinner selectSex;
	private Spinner selectAge;
	private Spinner selectRegion;
	private Button ruleToSearchedFriendInfo;
	
	/* (non-Javadoc)
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.search_friend_by_rule);
		selectSex = (Spinner) findViewById(R.id.select_sex);
		selectAge = (Spinner) findViewById(R.id.select_age);
		selectRegion = (Spinner) findViewById(R.id.select_region);
		ruleToSearchedFriendInfo = (Button) findViewById(R.id.rule_to_searched_friend_info);
		
		ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(SearchFriendByRule.this, R.layout.select_sex_item, R.id.select_sex, new String[]{"男", "女"});
		selectSex.setAdapter(adapter1);
		
		ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(SearchFriendByRule.this, R.layout.select_age_item, R.id.select_age, new String[]{"18", "19", "20", "21", "22"});
		selectAge.setAdapter(adapter2);
		
		ArrayAdapter<String> adapter3 = new ArrayAdapter<String>(SearchFriendByRule.this, R.layout.select_region_item, R.id.select_region, new String[]{"北京", "上海", "郑州"});
		selectRegion.setAdapter(adapter3);
		
		ruleToSearchedFriendInfo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(SearchFriendByRule.this, ShowSearchedFriendInfo.class);
				startActivity(intent);
			}
		});
		
	}
	
}
